import java.util.Arrays;
import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String str = scanner.next();

        char[] ch = str.toCharArray();

        int[] index = new int[26];

        int len = ch.length;

        for (int i = 0; i < len; i++) {
            index[ch[i] - 'A']++;
        }

        int ret = 0;
        for (int i = 0; i < len; i++) {
            ret = Math.max(ret, index[i]);
        }

        for (int i = 0; i < len; i++) {
            if (index[i] == ret) {
                System.out.print((char)(i + 'A'));
            }
        }
    }
}
